{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import Counter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/uncommon-words-from-two-sentences\n",
    "\n",
    "\n",
    "Runtime: 32 ms, faster than 55.17% of Python3 online submissions for Uncommon Words from Two Sentences.\n",
    "Memory Usage: 14.4 MB, less than 16.21% of Python3 online submissions for Uncommon Words from Two Sentences.\n",
    "\n",
    "\n",
    "```python\n",
    "from collections import Counter\n",
    "\n",
    "class Solution:\n",
    "    def uncommonFromSentences(self, A: str, B: str) -> List[str]:\n",
    "        a = A.split(\" \")\n",
    "        b = B.split(\" \")\n",
    "        ac = Counter(a)\n",
    "        bc = Counter(b)\n",
    "        r = set(a) ^ set(b)\n",
    "        for v in r.copy():\n",
    "            i = 0\n",
    "            if v in ac:\n",
    "                i += ac[v]\n",
    "            if v in bc:\n",
    "                i += bc[v]\n",
    "            if i != 1:\n",
    "                r.remove(v)\n",
    "        return list(r)\n",
    "```\n",
    "\n",
    "\n",
    "Spent 23 minutes\n",
    "\n",
    "2 shoot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
